package com.itshare.video.pojo.bo;

import com.itshare.video.common.aop.xss.annontation.CleanXSS;
import com.itshare.video.common.core.constant.PatternsConstants;
import com.itshare.video.common.core.validator.support.phone.Phone;
import com.itshare.video.common.core.validator.support.value.EnumValue;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.annotation.RegEx;
import javax.validation.constraints.FutureOrPresent;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.PastOrPresent;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * 用户申请投放广告
 * @Author lyr
 * @create 2020/11/4 10:10
 */
@Data
public class AdvertisementDTO {

    /**
     * 公司名字
     */
    @NotBlank
    @CleanXSS
    private String companyName;
    @Phone
    private String phone;
    @Pattern(regexp = PatternsConstants.urlPattern,message = "url不符合格式")
    private String banner;

    /**
     * 1是学生,2是教师
     */
    @EnumValue(mustAllIn = {"1","2"},message = "必须是1,2,1是学生区域，2是教师区域")
    private Integer advertisementPutting;

    @CleanXSS
    @NotBlank(message = "联系人不能为空")
    private String contactPersonName;

    //
    /**
     * 广告开始时间
     */
    private Date beginTime;

    /**
     * 广告限期
     */
    @FutureOrPresent(message = "结束时间不能是空，不能是过去时间")
    private Date endTime;

}
